package com.beilang.base.core.page;

import com.beilang.hotline.user.model.UserModel;
import com.beilang.base.codelookup.model.CodeModel;

import flex.messaging.FlexContext;

public class BasePage {
	
	protected UserModel getLoginUser(){
        return (UserModel)FlexContext.getFlexSession().getAttribute("user");
    }

    public String getLoginUserId(){
        UserModel userModel =  (UserModel)FlexContext.getFlexSession().getAttribute("user");
        if (userModel!=null)
        {
            return userModel.getUserId();
        }
        return "";
    }

    protected CodeModel getEmptyCodeModel(){
        CodeModel codeModel=new CodeModel();
		codeModel.setCodeId("");
		codeModel.setCodeDesc("");
		return codeModel;
    }

    protected CodeModel getEmptyIntCodeModel(){
        CodeModel codeModel=new CodeModel();
		codeModel.setCodeId("0");
		codeModel.setCodeDesc("");
		return codeModel;
    }
}
